package com.xisoft.base.config.mybatis;

import org.apache.ibatis.reflection.MetaObject;
import org.apache.ibatis.reflection.property.PropertyTokenizer;
import org.apache.ibatis.reflection.wrapper.MapWrapper;

import java.util.Map;

public class MyMapWrapper extends MapWrapper
{

    public MyMapWrapper(MetaObject metaObject, Map< String,Object > map)
    { super(metaObject, map); }

    @Override
    public String findProperty(String name, boolean useCamelCaseMapping)
    { return name == null ? "" : name.toLowerCase(); }

    @Override
    public void set(PropertyTokenizer prop, Object value)
    {
        if (null == value)
        { value = String.valueOf(""); }
        
        super.set(prop, value);
    }
} 